/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:46 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Runtime.Serialization;
namespace hou_elearning.Entity
{
    [DataContract]
    public class SlideEntity
    {
        public SlideEntity()
        {
            pk_islideid = 0;
            stenslide = "";
            itrangthai = 1;
            sVideo = "";
			sghichu="";
            fk_ianhminhhoaid = 0;
            fk_inguoitaoid = 0;
            fk_inguoicapnhatid = 0;
            dthoidiemtao = DateTime.Now;
            dthoidiemcapnhat = DateTime.Now;
        }
		private Int64 pk_islideid;
        [DataMember]
        public Int64 PK_iSlideID
		{
            get { return pk_islideid; }
            set { pk_islideid = value; }
		}
        
        private String stenslide;
        [DataMember]
        public String sTenslide
        {
            get { return stenslide; }
            set { stenslide = value; }
        }
        
        private int itrangthai;
        [DataMember]
        public int iTrangthai
        {
            get { return itrangthai; }
            set { itrangthai = value; }
        }

        private String svideo;
        [DataMember]
        public String sVideo
        {
            get { return svideo; }
            set { svideo = value; }
        }
        
        private String sghichu;
        [DataMember]
        public String sGhichu
        {
            get { return sghichu; }
            set { sghichu = value; }
        }
        
        private Int64 fk_ianhminhhoaid;
        [DataMember]
        public Int64 FK_iAnhminhhoaID
        {
            get { return fk_ianhminhhoaid; }
            set { fk_ianhminhhoaid = value; }
        }
        
        private Int64 fk_inguoitaoid;
        [DataMember]
        public Int64 FK_iNguoitaoID
        {
            get { return fk_inguoitaoid; }
            set { fk_inguoitaoid = value; }
        }
        
        private Int64 fk_inguoicapnhatid;
        [DataMember]
        public Int64 FK_iNguoicapnhatID
        {
            get { return fk_inguoicapnhatid; }
            set { fk_inguoicapnhatid = value; }
        }
        
        private DateTime dthoidiemtao;
        [DataMember]
        public DateTime dThoidiemtao
        {
            get { return dthoidiemtao; }
            set { dthoidiemtao = value; }
        }
        
        private DateTime dthoidiemcapnhat;
        [DataMember]
        public DateTime dThoidiemcapnhat
        {
            get { return dthoidiemcapnhat; }
            set { dthoidiemcapnhat = value; }
        }

        #region Comparison
        public static List<SlideEntity> Sort(List<SlideEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo = typeof(SlideEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null, null) as Comparison<SlideEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        #endregion
    }
}
